<template>
	<h2>我是爷组件</h2>
	<div>爷组件参数: {{ a }}==={{ b }}==={{ c }}==={{ d }}</div>
	<Father :a="a" :b="b" :c="c" :d="d" :handleChange="handleChange"/>
</template>
<script lang="ts" setup>
import type { objInterface } from '@/interface'

import Father from "./Father.vue";
const a = ref(1000);
const b = ref(2000);
const c = ref(3000);
const d = reactive<objInterface>({
	name: '张三'
})

const handleChange = (value: number) => {
	c.value = value;
}

const changeA = (value: number) => {
	a.value += value;
}

const changeD = (value: string) => {
	d.name = value;
}

provide('sendSon', { aVal: a, changeA, changeD });
</script>
